package com.project.zsxd.server.tag.controller;


import com.alibaba.fastjson.JSONObject;
import com.project.zsxd.server.annotation.LoginPass;
import com.project.zsxd.server.common.bean.Result;
import com.project.zsxd.server.tag.entity.Tag;
import com.project.zsxd.server.tag.service.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 标签表 前端控制器
 * </p>
 *
 * @author kaler
 * @since 2021-07-05
 */
@RestController
@RequestMapping("/tag")
public class TagController {

    @Autowired
    private ITagService tagService;

    @LoginPass
    @PostMapping("queryTagsByType")
    public Result queryTagsByType(@RequestBody JSONObject param) {
        List<Tag> tags = tagService.queryTagsByType(param.getString("tagType"));
        return Result.success(tags);
    }

}
